<div class="mainbox">
	<div class="choselist">
		<a href="#default/goods_list?id=3" class="{{cPrivate1}}">全部商品</a>
		<a href="#default/goods_list?id=2" class="{{cPrivate2}}">销量最高</a>
	</div>
	<div class="eachtag">
		{{#each goods}}
		<egoodsitem
            href="{{_id}}"
            src="{{preview_img_url}}"
            goodsname="{{goods_name}}"
            price="{{price+'/'+unit}}"
        ></egoodsitem>
        {{/each}}
	</div>
</div>
<div class="getmore">
    {{#if loadingoods}}
    <p>正在加载</p>
    {{#else}} {{#if isresult}}
    <button event-click="{{'$Event.getMoreGoods'}}">查看更多商品</button>
    {{#else}}
    <p>没有更多东西了</p>
    {{/if}} {{/if}}
</div>

<xmp type="tag" name="egoodsitem">
    <a href="#default/goods_details?id=${href}">
        <div class="goodsitem">
            <img bind-src="${src}?imageView/1/w/150" />
            <div class="goodsinfo">
                <div class="item">${goodsname}</div>
                <div class="item">
                    <span class="price">￥${price}</span>
                </div>
            </div>
        </div>
    </a>
    <script type="text/vm">
    function(vm){
        var goodsitem=vm.queryElement({
            className:"goodsitem"
        })[0];
        require(["jQuery"], function() {
            if ($(document).width() > 500) {
                $(goodsitem).css({
                    'width': '31%'
                });
            };
        })
    }
    </script>
</xmp>
